<?php
/**
 * SessionModel.class.php   session管理模型类
 *
 * @author                  mashanling(msl-138@163.com)
 * @date                    2012-09-18 14:47:52
 * @last modify             2012-09-19 10:21:13 by mashanling
 */

!defined('ROOT') && exit('Access Denied');

class SessionModel extends CommonModel {
    protected $auto = array(//自动填充
        'last_time'    => 'gmtime',
        'user_id'      => 'get_user_id',
        'user_ip'      => 'get_client_ip#1',
        'admin_id'     => 'getAdminId',
        'page_url'     => 'getPageUrl',
        'referer_url'  => 'getRefererUrl',
        'controller'   => array('string', MODULE_NAME),
        'action'       => array('string', ACTION_NAME),
    );
    protected $db_fields = array (
        'session_id'     => null,//session id
        'data'           => null,//session内容
        'controller'     => null,//控制器
        'action'         => null,//操作方法
        'last_time'      => null,//最后活跃时间
        'page_url'       => null,//日志页面
        'referer_url'    => null,//来路页面
        'admin_id'   	 => null,//管理员ip
        'user_id'   	 => null,//管理员id
        'user_ip'        => null,//管理员姓名
    );
    protected $pk = 'session_id';//主键
    protected $true_table_name = TB_SESSION;//表
}